In video encoding in bidirectional communication, a size of a virtual buffer is significantly reduced to implement a low delay. Thus, in an intra-picture and an inter-picture subsequent thereto at the time of an encoding start or a scene change, buffer underflow tends to occur.
In this situation, for example, it is possible to reduce the possibility of the buffer underflow by applying technology described in Patent Document 1 at the time of intra-picture insertion and in an inter-picture subsequent thereto. In this method, when each block is encoded, normal encoding is performed when a previously accumulated generated code amount is small and simplified encoding in which the generated code amount is significantly small is forcibly performed when the previously accumulated generated code amount is large.
Here, the normal encoding is encoding using an encoding parameter (a motion vector or the like) obtained by a motion search/mode determination/quantization control or the like, and the simplified encoding is encoding using a forcibly determined parameter so that the generated code amount is reduced without using a result of the motion search/mode determination/quantization control or the like. For example, in the simplified encoding, encoding in which the motion vector is set to 0 and the quantization step is maximized is performed. That is, the simplified encoding is encoding in which the limitation of a value of the encoding parameter is greater than in the normal encoding. The encoding parameter is numerical value data serving as an encoding target, and represents a macroblock mode number, a quantization parameter, a motion vector, a prediction residual quantization value, or the like.
FIG. 9 is a diagram illustrating an example of a conventional video encoding device. When an encoding target picture (image) is input, a block encoding control unit 201 divides the picture into blocks, each of which is an encoding unit. When an accumulated generated code amount from a previously accumulated generated code amount is less than a predetermined threshold value for each division block, a normal encoding unit 202 performs normal encoding on the block. When the accumulated generated code amount is greater, a simplified encoding unit 203 performs simplified encoding on the block. A quantization control unit 204 receives notifications of generated code amounts from the normal encoding unit 202 and the simplified encoding unit 203, determines a quantization step when the normal encoding is performed, and notifies the normal encoding unit 202 of the determined quantization step.
FIG. 10 is a processing flowchart of a video encoding method in the conventional technology. For each input picture, the process of steps S401 to S408 is iterated. In addition, for blocks into which the picture is divided, the process of steps S402 to S407 is iterated. In step S403, an accumulated generated code amount threshold value according to the number of encoded blocks is set. In step S404, it is determined whether the previously accumulated generated code amount is less than the accumulated generated code amount threshold value set in step S403. When the previously accumulated generated code amount is less, the process proceeds to step S405. When the previously accumulated generated code amount is greater, the process proceeds to step S406. In step S405, the normal encoding is performed on an encoding target block. In step S406, the simplified encoding is performed on the encoding target block. The above process is iterated on all blocks within the picture, and a similar process is iterated on the next picture if encoding on one picture ends.